const taskList = [
  {
    taskId: "111",
    task: "完成3个页面",
    start: "2020-01-02 12:09:45",
    end: "2020-01-03 12:09:45",
    executors: ["张三", "李华"],
    completion: ""
  },
  {
    taskId: "222",
    task: "完成API文档",
    start: "2020-01-02 12:09:45",
    end: "2020-01-03 12:09:45",
    executors: ["lisa"],
    completion: ""
  },
  {
    taskId: "333",
    task: "完成项目介绍文档",
    start: "2020-01-02 12:09:45",
    end: "2020-01-03 12:09:45",
    executors: ["jack"],
    completion: ""
  },
  {
    taskId: "444",
    task: "完成需求文档",
    start: "2020-01-02 12:09:45",
    end: "2020-01-03 12:09:45",
    executors: ["jack", "李华"],
    completion: ""
  }
];

const chartOption = {
  tooltip: {
    trigger: "axis",
    axisPointer: {
      // 坐标轴指示器，坐标轴触发有效
      type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
    },
    formatter:
      '{b}<br />\
                	<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#11a0f8"></span>\
                	{a0}：{c0}%<br />\
                	<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#7ace4c"></span>\
                	{a1}：{c1}%<br />\
                	<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#ffbb44"></span>\
                	{a2}：{c2}%<br />'
  },
  legend: {
    data: ["未完成", "已完成", "实际完成"]
  },
  grid: {
    left: "3%",
    right: "4%",
    bottom: "3%",
    containLabel: true
  },
  xAxis: [
    {
      type: "category",
      data: [
        "1月",
        "2月",
        "3月",
        "4月",
        "5月",
        "6月",
        "7月",
        "8月",
        "9月",
        "10月",
        "11月",
        "12月"
      ]
    }
  ],
  yAxis: [
    {
      type: "value"
    }
  ],
  series: [
    {
      name: "未完成",
      type: "bar",
      stack: "完成量",
      data: [20, 30, 50, 48, 79, 10, 90, 30, 24, 10, 23, 45]
    },
    {
      name: "已完成",
      type: "bar",
      stack: "完成量",
      data: [80, 70, 50, 52, 21, 90, 10, 70, 76, 90, 77, 55]
    },
    {
      name: "实际完成",
      type: "bar",
      stack: "完成量",
      data: [80, 67, 45, 34, 20, 89, 12, 67, 70, 88, 70, 54]
    }
  ]
};

module.exports = [
  //分配任务
  {
    url: "/manager/giveTasks",
    type: "post",
    result: () => {
      return {
        code: 200,
        data: {
          msg: "分配任务成功"
        }
      };
    }
  },
  //获取任务列表
  {
    url: "/performance/getTaskList",
    type: "get",
    result: () => {
      return {
        code: 200,
        data: {
          taskList,
          total:taskList.length
        }
      };
    }
  },
  //提交任务完成情况
  {
    url: "/performance/completion",
    type:"post",
    result:()=>{
      return{
        code:200,
        data:{
          msg:"提交成功"
        }
      }
    }
  },
  //员工绩效页面柱形图数据
  {
    url:'/performance/chartView',
    type:"get",
    result:()=>{
      return{
        code:200,
        data:{ chartOption }
      }
    }
  }
];